/* I've declared a structure of 2 elements, but assigned 4 elements.
   The display statement repeats the 2nd element values for the remaining element as well.
   But the compilation DOESN'T show any errors/warnings
*/

module structure_init;

typedef struct {
   string filter_name = "temp"; -- this value is used if no assignment is made
   byte unsigned number_of_taps ;
   real fs ;
   } filter_info ;
   
filter_info ddc_filters[1:0] ; //I've declared only 2 elements, but assigned 4 elements

initial
begin
   ddc_filters[0] = '{ "HB1", 17, 122.88e6};
   ddc_filters[1] = '{ filter_name:"HB2", fs:61.44e6, number_of_taps:15 };
   ddc_filters[2] = '{ filter_name:"HB3", fs:61.44e6, number_of_taps:18 };
   ddc_filters[3] = '{default:0};   
   
   $display("Filter Name: %s, No_of_Taps: %d, Sampling Frequency: %e", ddc_filters[0].filter_name, 
                                                           ddc_filters[0].number_of_taps, ddc_filters[0].fs);
   $display("Filter Name: %s, No_of_Taps: %d, Sampling Frequency: %e", ddc_filters[1].filter_name, 
                                                           ddc_filters[1].number_of_taps, ddc_filters[1].fs);
   $display("Filter Name: %s, No_of_Taps: %d, Sampling Frequency: %e", ddc_filters[2].filter_name, 
                                                           ddc_filters[2].number_of_taps, ddc_filters[2].fs);
   $display("Filter Name: %s, No_of_Taps: %d, Sampling Frequency: %e", ddc_filters[3].filter_name, 
                                                           ddc_filters[3].number_of_taps, ddc_filters[3].fs);
end

endmodule
